public class gushi {
    public static void main(String[]args) {
//         String s1 = new String("汉皇重色思倾国御宇多年求不得杨家有女初长成养在深闺人未识天生丽质难自弃一朝选在君王侧回眸一笑百媚生六宫粉黛无颜色春寒赐浴华清池温泉水滑洗凝脂侍儿扶起娇无力始是新承恩泽时云鬓花颜金步摇芙蓉帐暖度春宵春宵苦短日高起从此君王不早朝承欢侍宴无闲暇春从春游夜专夜后宫佳丽三千人三千宠爱在一身金屋妆成娇侍夜玉楼宴罢醉和春姊妹弟兄皆列士可怜光采生门户遂令天下父母心不重生男重生女骊宫高处入青云仙乐风飘处处闻缓歌慢舞凝丝竹尽日君王看不足渔阳鼙鼓动地来惊破霓裳羽衣曲九重城阙烟尘生千乘万骑西南行<未完，待续>");
    String s2;
    String s3 = "";
    String s4 = new String();
    String s5;
    String s6 = new String();
//         String s7;
    int a = 0;
    int i = 6;
    int count = 0;
    System.out.println("请输入需要处理的文本：");
    Scanner sca = new Scanner(System.in);
    String s1 = sca.next();
    while (true) {
        s2 = s1.substring(a, i + 1);
        if (i % 2 == 0) {
            s3 = s2 + '，';
        }
        if (i % 2 != 0) {
            s4 = s2 + '。';
            s5 = s3 + s4;
            System.out.println(s5);
        }
        a = i + 1;
        i += 7;
        if (i > 238) {
            break;
        }
    }
    s6 = s1.substring(238, s1.length());
    System.out.println(s6);
    char A[];
    A = s1.toCharArray();


     for (int I=0;I<s1.length();I++) {
         System.out.print(A[I]+"\n");
     }
        System.out.print(s1.length());
     char A [] = new char[s1.length()];
     for (int I=0;I<=s1.length();I++){
         s7=s1.substring(I,I+1);
         System.out.println(s7);
         A[I]=s7.charAt(0);}
     System.out.println(A);
     String A [] = new String[]{"汉皇重色思倾国御宇多年求不得杨家有女初长成养在深闺人未识天生丽质难自弃一朝选在君王侧回眸一笑百媚生六宫粉黛无颜色春寒赐浴华清池温泉水滑洗凝脂侍儿扶起娇无力始是新承恩泽时云鬓花颜金步摇芙蓉帐暖度春宵春宵苦短日高起从此君王不早朝承欢侍宴无闲暇春从春游夜专夜后宫佳丽三千人三千宠爱在一身金屋妆成娇侍夜玉楼宴罢醉和春姊妹弟兄皆列士可怜光采生门户遂令天下父母心不重生男重生女骊宫高处入青云仙乐风飘处处闻缓歌慢舞凝丝竹尽日君王看不足渔阳鼙鼓动地来惊破霓裳羽衣曲九重城阙烟尘生千乘万骑西南行<未完，待续>"};
     System.out.println(Arrays.toString(A));
     System.out.println(A[0]);
     System.out.println("请输入一个需要检索次数的字：");
    Scanner scanner = new Scanner(System.in);
    String web = scanner.next();
    char wb = web.charAt (0);
    System.out.println(wb);
    for (int I=0;I<s1.length();I++){
        if(A[I]==wb){
            count+=1;
        }
    }
    System.out.println("该字出现的次数为："+count);
}
}
